From 39f1d761c90a844417341c85c07d7dac1441f8e9 Mon Sep 17 00:00:00 2001 From: Jens Frank Date: Sun, 3 Oct 2004 09:53:39 +0000 Subject: [PATCH] Fixes needed to make redirect.php work with MEDIAWIKI checks, i18n and without explicitely set include_path --- includes/WebRequest.php | 4 +++- redirect.php | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/includes/WebRequest.php b/includes/WebRequest.php index 271d41d02e..3204346ac2 100644 --- a/includes/WebRequest.php +++ b/includes/WebRequest.php @@ -115,7 +115,9 @@ class WebRequest { strncmp($wgServer, $_SERVER['HTTP_REFERER'], strlen( $wgServer ) ) ) ) { # For links that came from outside, check for alternate/legacy # character encoding. - $data = $wgContLang->checkTitleEncoding( $data ); + if ( isset( $wgContLang ) ) { + $data = $wgContLang->checkTitleEncoding( $data ); + } } if( !$wgUseLatin1 ) { require_once( 'normal/UtfNormal.php' ); diff --git a/redirect.php b/redirect.php index 6b69aee824..2f50814af3 100644 --- a/redirect.php +++ b/redirect.php @@ -2,11 +2,12 @@ unset( $DP ); unset( $IP ); $wgCommandLineMode = false; +define( "MEDIAWIKI", true ); require_once( "./LocalSettings.php" ); global $wgArticlePath; -require_once( "WebRequest.php" ); +require_once( "includes/WebRequest.php" ); $wgRequest = new WebRequest(); $page = $wgRequest->getVal( "wpDropdown" ); -- 2.20.1